package com.xdl.backstage.base.entity;

import java.util.Date;

import com.xdl.backstage.base.domain.Company;
import com.xdl.moudle.utils.util.DateUtil;
import com.xdl.moudle.utils.util.EnumUtil.OpearteMode;
import com.xdl.moudle.utils.util.UUIDGenerator;

public class CompanyEntity {

	private String id;

	private String code;

	private String name;

	private String content;

	private String companyDesc;

	private String logo;

	private Boolean isEnable;

	private String comment;

	private String backgroundImg;

	private Date createTime;

	private UserManagerEntity createUser;

	private Date updateTime;

	private UserManagerEntity updateUser;

	public String getId() {
		return id;
	}

	public CompanyEntity() {
		this.setId(UUIDGenerator.getUUID());
		this.setCreateTime(DateUtil.getCurrentDateTime());
	}

	public CompanyEntity(Company data) {
		if (data != null) {
			this.setId(data.getId());
			this.setCode(data.getCode());
			this.setName(data.getName());
			this.setContent(data.getContent());
			this.setCompanyDesc(data.getCompanyDesc());
			this.setLogo(data.getLogo());
			this.setIsEnable(data.getIsEnable());
			this.setComment(data.getComment());
			this.setBackgroundImg(data.getBackgroundImg());
			this.setCreateTime(data.getCreateTime());
			this.setUpdateTime(data.getUpdateTime());
		}
	}

	public Company entityToData() {
		Company data = new Company();
		data.setId(this.getId());
		data.setCode(this.getCode());
		data.setName(this.getName());
		data.setContent(this.getContent());
		data.setCompanyDesc(this.getCompanyDesc());
		data.setLogo(this.getLogo());
		data.setIsEnable(this.getIsEnable());
		data.setComment(this.getComment());
		data.setBackgroundImg(this.getBackgroundImg());
		data.setCreateTime(this.getCreateTime());
		data.setUpdateTime(this.getUpdateTime());
		return data;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getCompanyDesc() {
		return companyDesc;
	}

	public void setCompanyDesc(String companyDesc) {
		this.companyDesc = companyDesc;
	}

	public String getLogo() {
		return logo;
	}

	public void setLogo(String logo) {
		this.logo = logo;
	}

	public Boolean getIsEnable() {
		return isEnable;
	}

	public void setIsEnable(Boolean isEnable) {
		this.isEnable = isEnable;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getBackgroundImg() {
		return backgroundImg;
	}

	public void setBackgroundImg(String backgroundImg) {
		this.backgroundImg = backgroundImg;
	}

	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public UserManagerEntity getCreateUser() {
		return createUser;
	}

	public void setCreateUser(UserManagerEntity createUser) {
		this.createUser = createUser;
	}

	public UserManagerEntity getUpdateUser() {
		return updateUser;
	}

	public void setUpdateUser(UserManagerEntity updateUser) {
		this.updateUser = updateUser;
	}

}
